package deibay.server.frontend;

import java.io.IOException;

public class StringReader extends Console {

	static String readLn (int maxLg)  // utility function to read from stdin
    {

        byte lin[] = new byte [maxLg];

        int lg = 0, car = -1;

        String line = "";

        try

        {

            while (lg < maxLg)

            {

                car = System.in.read();

                if ((car < 0) || (car == '\n')) break;

                lin [lg++] += car;

            }

        }

        catch (IOException e)

        {

            return (null);

        }





        if ((car < 0) && (lg == 0)) return (null);  // eof

        return (new String (lin, 0, lg).trim());

    }
}
